<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<HTML>
<HEAD>
<TITLE>80386 Programmer's Reference Manual -- Opcode PUSHF</TITLE>
</HEAD>
<BODY STYLE="width:80ch">
<B>up:</B> <A HREF="c17.htm">
Chapter 17 -- 80386 Instruction Set</A><BR>
<B>prev:</B><A HREF="PUSHA.htm"> PUSHA/PUSHAD Push all General Registers</A><BR>
<B>next:</B><A HREF="RCL.htm"> RCL/RCR/ROL/ROR Rotate</A>
<P>
<HR>
<P>
<H1>PUSHF/PUSHFD -- Push Flags Register onto the Stack</H1>

<PRE>
Opcode  Instruction  Clocks   Description

9C      PUSHF        4        Push FLAGS
9C      PUSHFD       4        Push EFLAGS
</PRE>


<H2>Operation</H2>

<PRE>
IF OperandSize = 32
THEN push(EFLAGS);
ELSE push(FLAGS);
FI;
</PRE>

<H2>Description</H2>

PUSHF decrements the stack pointer by 2 and copies the FLAGS
register to the new top of stack; PUSHFD decrements the stack pointer by
4, and the 80386 EFLAGS register is copied to the new top of stack
which is pointed to by SS:eSP. Refer to 
<A HREF="c02.htm">Chapter 2</A> and 
<A HREF="c04.htm">Chapter 4</A> for 
information on the EFLAGS register.

<H2>Flags Affected</H2>

None

<H2>Protected Mode Exceptions</H2>

#SS(0) if the new value of eSP is outside the stack segment boundaries

<H2>Real Address Mode Exceptions</H2>

None; the 80386 shuts down due to a lack of stack space

<H2>Virtual 8086 Mode Exceptions</H2>

#GP(0) fault if IOPL is less than 3, to permit emulation


<P>
<HR>
<P>
<B>up:</B> <A HREF="c17.htm">
Chapter 17 -- 80386 Instruction Set</A><BR>
<B>prev:</B><A HREF="PUSHA.htm"> PUSHA/PUSHAD Push all General Registers</A><BR>
<B>next:</B><A HREF="RCL.htm"> RCL/RCR/ROL/ROR Rotate</A>
</BODY>
